@extends('shopWx.global')

@section('content')
<div class="page page-current" id="list">
    <header class="bar bar-nav">
        <a class="icon icon-menu pull-left open-panel" data-panel='#panel-left-demo'></a>
        <h1 class="title">{{ (isset($_GET['typeID']) && isset($classify[$_GET['typeID']])) ? $classify[$_GET['typeID']]->name : ((isset($_GET['recommendID']) && isset($recommends[$_GET['recommendID']])) ? $recommends[$_GET['recommendID']]->title : '全て') }}</h1>
    </header>
    <div class="content infinite-scroll" id="infinite-list" data-ptr-distance="100">
        <!--列表-->
        <div class="content-padded recommend">

            <div class="list-block media-list" id="page-data-list" data-url="{{ action('Shop\ListController@getIndexAjax') }}" data-page="1" data-typeid="{{ isset($_GET['typeID']) ? $_GET['typeID'] : '' }}" data-recommendid="{{ isset($_GET['recommendID']) ? $_GET['recommendID'] : '' }}" data-sort="{{ isset($_GET['sort']) ? $_GET['sort'] : '' }}">
                <input type="hidden" name="page" value="1">
                <ul>
                    @foreach($goods as $v)
                        <li data-id="{{ $v->id }}" data-thumb="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '110x90']) }}" data-title="{{ $v->title }}" data-price="{{ $v->realAmount }}" data-intro="{{ $v->abstract }}" data-sv="135" data-num="12">
                            <div class="item-content">
                                <a href="#" class="item-slicer-link item-media">
                                    <img class="cart-image lazy" src="{{ asset('style/shopWx/img/lazy.png') }}" data-original="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '110x90']) }}">
                                </a>
                                <div class="item-inner">
                                    <div class="item-title-row no-icon">
                                        <div class="item-title">{{ $v->title }}</div>
                                        <div class="item-after">{{ $v->realAmount }} 円</div>
                                    </div>
                                    <div class="item-subtitle">販売量 {{ $v->hit }} 件</div>
                                    <div class="item-text">{{ $v->abstract }}</div>
                                    <div class="item-buy">
                                        <div class="row no-gutter">
                                            <div class="col-40"></div>
                                            <div class="col-20 subtract">
                                                <i class="fa fa-cart-arrow-down fa-2x"></i>
                                            </div>
                                            <div class="col-20"></div>
                                            <div class="col-20 plus">
                                                <i class="fa fa-cart-plus fa-2x"></i>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                    @endforeach
                </ul>
            </div>

        </div>
        <!--列表结束-->
        <!-- 加载提示符 -->

    </div>
    @include('shopWx.footer-menu')
</div>
<div class="panel-overlay"></div>
<!-- Left Panel with Reveal effect -->
<div class="panel panel-left panel-reveal theme-dark custom-left-menu" id='panel-left-demo'>

    <div class="list-block">
        <ul>
            <a class="external @if(!isset($_GET['typeID']) || $_GET['typeID'] == 0){{ 'active' }}@endif" href="{{ action('Shop\ListController@getIndex') }}"><li><img src="{{ asset('style/shopWx/img/All.png') }}" alt="全て">全て</li></a>
            @foreach($classify as $v)
                <a class="external @if(isset($_GET['typeID']) && $_GET['typeID'] == $v->id){{ 'active' }}@endif" href="{{ action('Shop\ListController@getIndex', ['typeID' => $v->id]) }}"><li><img src="{{ action('ImgController@getPicture', ['sourceName' => $v->icon, 'size' => '50x50']) }}" alt="{{ $v->name }}">{{ $v->name }}</li></a>
            @endforeach
        </ul>
    </div>
    <br/>
    @if(count($recommends) == 5)
    <div class="list-block">
        <ul>
            @foreach($recommends as $v)
                <a class="external @if(isset($_GET['recommendID']) && $_GET['recommendID'] == $v->id){{ 'active' }}@endif" href="{{ action('Shop\ListController@getIndex', ['recommendID' => $v->id]) }}"><li><img src="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '50x50']) }}" alt="{{ $v->title }}">{{ $v->title }}</li></a>
            @endforeach
        </ul>
    </div>
    @endif
</div>
@endsection